package cn.lock;

import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class LockDealThreadTest implements Runnable {
    private int count = 100;
    Lock lock = new ReentrantLock();
    Condition condition = lock.newCondition();

    @Override
    public void run() {
        while (count > 0) {
            lock.lock();
            System.out.println(Thread.currentThread().getName() + "------" + count);
            count--;
            lock.unlock();
        }
    }
}
